#!/bin/bash

sum=0;

if [ $# -eq 2 ]
then
	if [ $1 -eq $2 ]
	then
		echo sum=$1
	elif [ $1 -lt $2 ]
	then
		for ((i=$1;i<=$2;i++))
		do
			sum=$[$sum + $i]
		done
		echo "总和为：$sum"
	
	elif [ $1 -gt $2 ]
	then
	 	for ((i=$2;i<=$1;i++))
		do
			sum=$[$sum + $i]
		done
		echo "总和为：$sum"
	fi
else
	echo "请指定两个数值参数"
fi

